package com.linkwechat.web.controller.c.wecome;

import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.wecom.c.service.IWeAppService;
import com.linkwechat.wecom.domain.WeApp;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author oweson
 * @date 2022/2/16 22:26
 */

@RestController
@RequestMapping("/c/wecom/weapp")
@AllArgsConstructor
public class WeAppController {
    private final IWeAppService iWeAppService;

    @GetMapping("/list")

    public AjaxResult list() {
        return AjaxResult.success(iWeAppService.list());
    }

    @PostMapping("/addWeApp")
    public AjaxResult addWeApp(@RequestBody WeApp weApp) {

        iWeAppService.addWeApp(weApp);

        return AjaxResult.success();
    }


    @PutMapping("/updateWeApp")
    public AjaxResult updateWeApp(@RequestBody WeApp weApp) {
        iWeAppService.updateWeApp(weApp);
        return AjaxResult.success();
    }

}
